package com.itheima.controller;


import com.itheima.domain.User;
import com.itheima.service.UserService;
import com.itheima.service.impl.UserServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserController {
    public static void main(String[] args) throws Exception{
        //1、创建spring核心容器IOC
        ApplicationContext ac=new ClassPathXmlApplicationContext("spring.xml");
//        //2、从容器获取Bean对象
//        UserService userService = (UserService) ac.getBean("userService");
//        userService.findAll();
//
//        UserService us=new UserServiceImpl();
       /* User u=new User();
        u.eat();

        User u1 = (User)ac.getBean("u");
        u1.eat();*/
    }
}
